<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Order extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->database();
		$this->load->model('admin/commodity_m');
	}
	
	public function index(){
		
		$header_data = array();
		$footer_data = array();
		
		//add css
		$header_data['add_css'][] = '/zswebshop/include/css/jquery.datetimepicker.css';
		
		//add script
		$footer_data['add_script'][] = '/zswebshop/include/js/jquery.datetimepicker.js';
		$footer_data['add_script'][] = '/zswebshop/include/admin/js/order.js';
		
		$this->load->library('form_validation');
		$this->load->view('admin/common/header', $header_data);
		$this->load->view('admin/order/order_list', array('list'=>array()));
		$this->load->view('admin/common/footer', $footer_data);
	}
	
	public function search(){
		
		echo ($this->input->post('s_commoditycode_from'));
		echo ($this->input->post('s_commoditycode_to'));
		$this->load->library('form_validation');
// 		$this->form_validation->set_rules('s_commoditycode_from', '제목', 'required');
// 		$this->form_validation->run();
		
		$this->load->view('admin/common/header');
		$list = $this->commodity_model->searchlist();
		$this->load->view('admin/order/order_list', array('list'=>$list));
		$this->load->view('admin/common/footer');
	}
	
	public function detail($sku_code){
		$this->load->view('admin/common/header');
		$detail = $this->commodity_model->order_detail($sku_code);
		$this->load->view('admin/order/detail', array('detail'=>$detail));		
		$this->load->view('admin/common/footer');
	}
	
}
